<%@ page language="java" pageEncoding="utf-8"%>
<%@ page import="java.util.*" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<jsp:useBean  id="share" class="web.dmt.dao.factory.DAOFactory"/>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html lang="true">
  <head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>社团评选投票系统</title>
<style type="text/css">
<!--
body,td,th {
	font-size: 12px;
}
#tab{
	border:1px solid green ;
	display:none ;
	margin-left:110px;
}
-->
</style>
<%
	session.setAttribute("user","2");
%>
${requestScope.file}
<script language="javaScript">
<!--
		var xmlHttp ;
		function createXMLHttp(){
			if(window.ActiveXObject){
				try {  
         			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");  
     			} catch (e) {  
          			try {  
             			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
          			} catch (e) {}  
     			} 
			} else if(window.XMLHttpRequest){
				xmlHttp = new XMLHttpRequest() ;
			}
		}
		function hz(){  //取得后缀
			createXMLHttp() ;
			xmlHttp.open("POST","upload?action=hz");
			xmlHttp.onreadystatechange = hzCallback ;
			xmlHttp.send(null) ;
		}
		function hzCallback(){
			if(xmlHttp.readyState==4){
				if(xmlHttp.status==200){
					var text = xmlHttp.responseText ;
					var div1 = document.getElementById('select') ;

					if(text!=null){
						div1.innerHTML = text ;
					}
				}
			}
		}
		function getHz(hz){ //取得内容
			xmlHttp.open("POST","upload?hz="+hz);
			xmlHttp.onreadystatechange = getHzCallback ;
			xmlHttp.send(null); 
		}
		function getHzCallback(){
		
			if(xmlHttp.readyState==4){
				if(xmlHttp.status==200){
					var getHz = xmlHttp.responseText ;
					var table = document.getElementById('table1');
					if(getHz!=null){
						table.innerHTML = getHz ;
					}
				}else{
					alert("未完成");
				}
			}
		}
		//搜索处
		function yq(seek){
			createXMLHttp() ;
			seek = encodeURI(seek); //解决中午乱码
			//alert(seek);
			xmlHttp.open("POST","Show?action=cin&seek="+seek);
			xmlHttp.onreadystatechange = getYq;
			xmlHttp.send(null);
		}
		function getYq(){
			if(xmlHttp.readyState==4){
				if(xmlHttp.status==200){
					var getHz = xmlHttp.responseText ;
					var tab = document.getElementById('seek');
	     			tab.style.display = "block" ;
					if(getHz!=null){
						tab.innerHTML = getHz ;
					}
				}
			}
		}
		
-->
</script>
</head>
<body>
 <form action="upload.do" method="post" enctype="multipart/form-data" name="sub_upload" target="_self">
<input name="file" type="file" size="15">
<input type="submit" name="Submit" value="上传"><br/>
</form>
<br>
<a href="upload?action=look">查看下载列表</a><br>
<c:if test="${requestScope.size>0}" var="res2">
<table border="1">
	<tr><th>文件名</th><th>上传日期</th><th>后缀</th><th>上传者</th><th>下载</th></tr>
	<c:forEach items="${requestScope.cont}" var="co" >
		<tr><td>${co.stitle}</td><td>${co.sdate}</td><td>${co.shz}</td><td>${co.name}</td><td><a href="${co.scountent}">下载</a></td></tr>
	</c:forEach>
</c:if>
<br>
	<form>
		<select onfocus="hz();" id="select">
			<option>选择文件类型</option>
		</select>
	</form>
</table>
<table border="1" id="table1">
	
</table>
<br>
<hr><br>
<a href="${applicationScope.path }/Card?action=card">发帖</a>
<br>
<a href="${applicationScope.path }/Card?action=review">评论</a>
<br>
<a href="${applicationScope.path }/Card?action=activite">发布活动</a>
<br>
<a href="${applicationScope.path }/Card?action=join">参加活动</a>
<br>
<a href="${applicationScope.path }/Card?action=problem">发布提问</a>
<br>
<a href="${applicationScope.path }/Card?action=invite">邀请回答</a>
<br>
<a href="${applicationScope.path }/Card?action=answer">回答</a>
<br>
<a href="${applicationScope.path }/Card?action=pletter">发信</a>
<br>
<hr size="3" color="green">
<br>
<a href="${applicationScope.path }/Show?action=problem">问题列表</a>
<br>
<a href="${applicationScope.path }/Show?action=invite">邀请列表</a>
<br>
<a href="${applicationScope.path }/Show?action=pletter">查看私信</a>
<br>
<a href="${applicationScope.path }/Show?action=online">查看在线人员</a>
<br>
<a href="${applicationScope.path }/Show?action=remove">注销</a>
<br><hr><br>
<form action = "Card?action=invite" method="post" >
	邀请站内人员回答：<input type="text" onchange="yq(this.value);" value="" />
</form>
<div id="seek"></div>
</body>
</html:html>


